package org.yelongframework.excel.data.collect.sheet.mode.fors.down;

import java.util.function.Function;

import org.yelongframework.excel.data.collect.sheet.SheetDataCollectException;
import org.yelongframework.excel.data.collect.sheet.SheetDataCollectMode;
import org.yelongframework.excel.data.collect.sheet.SheetDataCollectScheme;
import org.yelongframework.excel.row.ExcelRow;
import org.yelongframework.lang.Nullable;

/**
 * 向下循环工作表数据收集方案。如果循环次数和结束行推断函数都为空时默认取到该工作表最后一行。
 * 
 * @since 1.0.0
 */
public class DownForSheetDataCollectScheme extends SheetDataCollectScheme {

	/** 起始行索引 */
	private int beginRowIndex;

	/** 起始列索引 */
	private int beginColumnIndex;

	/** 结束列索引 */
	private int endColumnIndex;

	/** 循环次数。优先级最高 */
	@Nullable
	private Integer forCount;

	/** 结束行推断函数。如果该行是结束行，则不会获取该行的数据。优先级最低 */
	@Nullable
	private Function<ExcelRow, Boolean> endRowDeduceFunction;

	// ==================================================构造器==================================================

	public DownForSheetDataCollectScheme() {
		super(SheetDataCollectMode.FOR_DOWN);
	}

	// ==================================================获取/设置==================================================

	public int getBeginRowIndex() {
		return beginRowIndex;
	}

	public void setBeginRowIndex(int beginRowIndex) {
		this.beginRowIndex = beginRowIndex;
	}

	public int getBeginColumnIndex() {
		return beginColumnIndex;
	}

	public void setBeginColumnIndex(int beginColumnIndex) {
		this.beginColumnIndex = beginColumnIndex;
	}

	public int getEndColumnIndex() {
		return endColumnIndex;
	}

	public void setEndColumnIndex(int endColumnIndex) {
		this.endColumnIndex = endColumnIndex;
	}

	public Integer getForCount() {
		return forCount;
	}

	public void setForCount(Integer forCount) {
		this.forCount = forCount;
	}

	public Function<ExcelRow, Boolean> getEndRowDeduceFunction() {
		return endRowDeduceFunction;
	}

	public void setEndRowDeduceFunction(Function<ExcelRow, Boolean> endRowDeduceFunction) {
		this.endRowDeduceFunction = endRowDeduceFunction;
	}

	// ==================================================校验==================================================

	@Override
	public void check() throws SheetDataCollectException {
	}

}
